home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutor.exe
/
ANSWERS
/
CH04_2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-15
|
437b
|
30 lines
main()
{
int index;
float inversion;
for(index = 1 ; index < 13 ; index = index + 1) {
inversion = 1.0/index;
printf("%5d%9.5f\n", index, inversion);
}
}
/* Result of execution
1 1.00000
2 .50000
3 .33333
4 .25000
5 .20000
6 .16667
7 .14286
8 .12500
9 .11111
10 .10000
11 .09091
12 .08333
*/